#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "windoweditorfase.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    logoPixmap(new QPixmap(":img/img/sokoban.png"))
{
    ui->setupUi(this);
    this->renderLogo();
}

MainWindow::~MainWindow()
{
    delete ui;
    delete this->logoPixmap;
    delete this->windowEditorFase;
    delete this->windowJogo;
}

void MainWindow::renderLogo()
{
    *this->logoPixmap = this->logoPixmap->scaled(this->ui->labelSokobanLogo->width(), this->ui->labelSokobanLogo->height());

    this->ui->labelSokobanLogo->setPixmap(*this->logoPixmap);
}

void MainWindow::on_buttonCriarFase_clicked()
{
    this->windowEditorFase = new WindowEditorFase();
    this->windowEditorFase->show();
}

void MainWindow::on_buttonJogar_clicked()
{
    this->windowJogo = new WindowJogo();
    this->windowJogo->show();
}
